/*
 * XML Type:  MailSyncRequest
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.MailSyncRequest
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML MailSyncRequest(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class MailSyncRequestImpl extends net.ofx.types.x2003.x04.impl.AbstractSyncRequestImpl implements net.ofx.types.x2003.x04.MailSyncRequest
{
    
    public MailSyncRequestImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName INCIMAGES$0 = 
        new javax.xml.namespace.QName("", "INCIMAGES");
    private static final javax.xml.namespace.QName USEHTML$2 = 
        new javax.xml.namespace.QName("", "USEHTML");
    private static final javax.xml.namespace.QName MAILTRNRQ$4 = 
        new javax.xml.namespace.QName("", "MAILTRNRQ");
    
    
    /**
     * Gets the "INCIMAGES" element
     */
    public net.ofx.types.x2003.x04.BooleanType.Enum getINCIMAGES()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INCIMAGES$0, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.BooleanType.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "INCIMAGES" element
     */
    public net.ofx.types.x2003.x04.BooleanType xgetINCIMAGES()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BooleanType target = null;
            target = (net.ofx.types.x2003.x04.BooleanType)get_store().find_element_user(INCIMAGES$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INCIMAGES" element
     */
    public void setINCIMAGES(net.ofx.types.x2003.x04.BooleanType.Enum incimages)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INCIMAGES$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INCIMAGES$0);
            }
            target.setEnumValue(incimages);
        }
    }
    
    /**
     * Sets (as xml) the "INCIMAGES" element
     */
    public void xsetINCIMAGES(net.ofx.types.x2003.x04.BooleanType incimages)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BooleanType target = null;
            target = (net.ofx.types.x2003.x04.BooleanType)get_store().find_element_user(INCIMAGES$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BooleanType)get_store().add_element_user(INCIMAGES$0);
            }
            target.set(incimages);
        }
    }
    
    /**
     * Gets the "USEHTML" element
     */
    public net.ofx.types.x2003.x04.BooleanType.Enum getUSEHTML()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USEHTML$2, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.BooleanType.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "USEHTML" element
     */
    public net.ofx.types.x2003.x04.BooleanType xgetUSEHTML()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BooleanType target = null;
            target = (net.ofx.types.x2003.x04.BooleanType)get_store().find_element_user(USEHTML$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "USEHTML" element
     */
    public void setUSEHTML(net.ofx.types.x2003.x04.BooleanType.Enum usehtml)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(USEHTML$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(USEHTML$2);
            }
            target.setEnumValue(usehtml);
        }
    }
    
    /**
     * Sets (as xml) the "USEHTML" element
     */
    public void xsetUSEHTML(net.ofx.types.x2003.x04.BooleanType usehtml)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BooleanType target = null;
            target = (net.ofx.types.x2003.x04.BooleanType)get_store().find_element_user(USEHTML$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BooleanType)get_store().add_element_user(USEHTML$2);
            }
            target.set(usehtml);
        }
    }
    
    /**
     * Gets array of all "MAILTRNRQ" elements
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest[] getMAILTRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(MAILTRNRQ$4, targetList);
            net.ofx.types.x2003.x04.MailTransactionRequest[] result = new net.ofx.types.x2003.x04.MailTransactionRequest[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "MAILTRNRQ" element
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest getMAILTRNRQArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().find_element_user(MAILTRNRQ$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "MAILTRNRQ" element
     */
    public int sizeOfMAILTRNRQArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MAILTRNRQ$4);
        }
    }
    
    /**
     * Sets array of all "MAILTRNRQ" element
     */
    public void setMAILTRNRQArray(net.ofx.types.x2003.x04.MailTransactionRequest[] mailtrnrqArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(mailtrnrqArray, MAILTRNRQ$4);
        }
    }
    
    /**
     * Sets ith "MAILTRNRQ" element
     */
    public void setMAILTRNRQArray(int i, net.ofx.types.x2003.x04.MailTransactionRequest mailtrnrq)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().find_element_user(MAILTRNRQ$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(mailtrnrq);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "MAILTRNRQ" element
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest insertNewMAILTRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().insert_element_user(MAILTRNRQ$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "MAILTRNRQ" element
     */
    public net.ofx.types.x2003.x04.MailTransactionRequest addNewMAILTRNRQ()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MailTransactionRequest target = null;
            target = (net.ofx.types.x2003.x04.MailTransactionRequest)get_store().add_element_user(MAILTRNRQ$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "MAILTRNRQ" element
     */
    public void removeMAILTRNRQ(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MAILTRNRQ$4, i);
        }
    }
}
